static const int OPT = 10;
// give aoz0 physical meaning
// x,y: aoz0, z0
void aoz(){
  // depict the pid spectrum //
  static const int NZ = 22, NI = 4; // NI: # of isotopes per Z
  static const int ZMAX = 37, ZMIN = ZMAX - NZ + 1;
  static const double p[NZ][NI] = { // [z][isotope][2ends][(x,y)]
    {2.06082, 2.09368, -1., -1.}, // z=37, Rb
    {2.0306, 2.06284, 2.1, 2.16951}, // z=36, Kr
    {2.032, 2.06587, 2.09924, -1.}, // z=35, Br
    {2.0315, 2.06638, 2.10126, -1.}, // z=34
    {2.0315, 2.0679, 2.10228, -1.}, // z=33
    {2.03504, 2.06992, 2.10581, -1.}, // z=32
    {2.03504, 2.07245, 2.10632, -1.}, // z=31
    {1.99965, 2.03554, 2.07245, 2.10935}, // z=30
    {1.99813, 2.03655, 2.07346, 2.11138}, // z=29
    {1.99813, 2.03655, 2.07447, 2.11188}, // z=28
    {1.99813, 2.03605, 2.07548, 2.1139}, // z=27
    {1.99813, 2.03655, 2.07801, 2.11643}, // z=26
    {1.99813, 2.03605, 2.07952, 2.11896}, // z=25
    {1.99813, 2.03908, 2.08104, 2.1225}, // z=24
    {1.99813, 2.0411, 2.08306, 2.12705}, // z=23
    {1.99813, 2.0411, 2.08407, 2.12856}, // z=22
    {1.99813, 2.04211, 2.08761, 2.13817}, // z=21
    {1.99813, 2.04515, 2.08913, 2.14474}, // z=20
    {1.9956, 2.04565, 2.09621, 2.14676}, // z=19
    {1.9956, 2.04717, 2.10379, 2.15738}, // z=18
    {2.00015, 2.0497, 2.10834, 2.168}, // z=17
    {2.00268, 2.05526, 2.11946, 2.18923}, // z=16
  };
  static const double A0 = 76, Z0 = 36; // the brightest spot
  static const double a[NZ][NI] = {
    {(A0+1)/(Z0+1), (A0+2)/(Z0+1), -1., -1.}, // z=37
    {(A0-2)/Z0, (A0-1)/Z0, A0/Z0, (A0+2)/Z0}, // z=36
    {(A0-4)/(Z0-1),   (A0-3)/(Z0-1),   (A0-2)/(Z0-1),   (A0-1)/(Z0-1)}, // z=35
    {(A0-6)/(Z0-2),   (A0-5)/(Z0-2),   (A0-4)/(Z0-2),   (A0-3)/(Z0-2)}, // z=34
    {(A0-8)/(Z0-3),   (A0-7)/(Z0-3),   (A0-6)/(Z0-3),   (A0-5)/(Z0-3)}, // z=33
    {(A0-10)/(Z0-4),  (A0-9)/(Z0-4),   (A0-8)/(Z0-4),   (A0-7)/(Z0-4)}, // z=32
    {(A0-12)/(Z0-5),  (A0-11)/(Z0-5),  (A0-10)/(Z0-5),  (A0-9)/(Z0-5)}, // z=31

    {(A0-15)/(Z0-6),  (A0-14)/(Z0-6),  (A0-13)/(Z0-6),  (A0-12)/(Z0-6)}, // z=30
    {(A0-17)/(Z0-7),  (A0-16)/(Z0-7),  (A0-15)/(Z0-7),  (A0-14)/(Z0-7)}, // z=29
    {(A0-19)/(Z0-8),  (A0-18)/(Z0-8),  (A0-17)/(Z0-8),  (A0-16)/(Z0-8)}, // z=28
    {(A0-21)/(Z0-9),  (A0-20)/(Z0-9),  (A0-19)/(Z0-9),  (A0-18)/(Z0-9)}, // z=27
    {(A0-23)/(Z0-10), (A0-22)/(Z0-10), (A0-21)/(Z0-10), (A0-20)/(Z0-10)}, // z=26
    {(A0-25)/(Z0-11), (A0-24)/(Z0-11), (A0-23)/(Z0-11), (A0-22)/(Z0-11)}, // z=25
    {(A0-27)/(Z0-12), (A0-26)/(Z0-12), (A0-25)/(Z0-12), (A0-24)/(Z0-12)}, // z=24
    {(A0-29)/(Z0-13), (A0-28)/(Z0-13), (A0-27)/(Z0-13), (A0-26)/(Z0-13)}, // z=23
    {(A0-31)/(Z0-14), (A0-30)/(Z0-14), (A0-29)/(Z0-14), (A0-28)/(Z0-14)}, // z=22
    {(A0-33)/(Z0-15), (A0-32)/(Z0-15), (A0-31)/(Z0-15), (A0-30)/(Z0-15)}, // z=21
    {(A0-35)/(Z0-16), (A0-34)/(Z0-16), (A0-33)/(Z0-16), (A0-32)/(Z0-16)}, // z=20
    {(A0-37)/(Z0-17), (A0-36)/(Z0-17), (A0-35)/(Z0-17), (A0-34)/(Z0-17)}, // z=19
    {(A0-39)/(Z0-18), (A0-38)/(Z0-18), (A0-37)/(Z0-18), (A0-36)/(Z0-18)}, // z=18
    {(A0-41)/(Z0-19), (A0-40)/(Z0-19), (A0-39)/(Z0-19), (A0-38)/(Z0-19)}, // z=17
    {(A0-43)/(Z0-20), (A0-42)/(Z0-20), (A0-41)/(Z0-20), (A0-40)/(Z0-20)} // z=16
  };


  TCanvas *c = new TCanvas("c", "aoz fit", 800, 600);
  double par[NZ][2]{}; // p0, p1
  char name[128]{};
  TFile *faoz = new TFile("aoz.root", "RECREATE");
  for(int i = 0; i < NZ; i++){
    // if(i != OPT) continue;
    int np = 0;
    for(int j = NI; j--;) if(-1. != p[i][j]) np++;
    TGraph *g = new TGraph(np, p[i], a[i]);
    sprintf(name, "z%d", int(Z0 - i + 1));
    g->SetNameTitle(name, name);
    g->SetMarkerStyle(20);
    g->SetMarkerColor(2);
    if(i == 1) g->Draw();
    g->Fit("pol1", "");
    TF1 *f = g->GetFunction("pol1");
    par[i][0] = f->GetParameter(0);
    par[i][1] = f->GetParameter(1);
    g->Write("", TObject::kOverwrite);
  } // end for over i
  faoz->Close();


  for(int i = 0; i < NZ; i++){
    cout << "\t\t{" << par[i][0] << ", " << par[i][1] << "}";
    if(i != NZ-1) cout << ",";
    cout << " // z=" << ZMAX - i << endl;
  } // end for over i
} // end member function aoz0Straight
